const { connectDb } = require("./db/core/index");
const { Patient } = require("./models/index");

connectDb(async () => {
  console.log("Database connected successfully");
  // 1. 启动数据库
  // 2. 启动业务服务

  try {
    const res = await Patient.create({
      id: "3",
      name: "ainilu",
      age: 20,
      gender: "男",
      address: "空岛",
    });
    console.log("***************");
    console.log(res);
  } catch (error) {
    console.log("---------------");
    console.log(error);
  }

  try {
    const res = await Patient.updateOne({ name: "one-pieces-ids" });
    console.log("***************");
    console.log(res);
  } catch (error) {
    console.log("---------------");
    console.log(error);
  }
});
